class_name GameplayEffectModifier
extends Resource

enum Operation {
	Override,
	Add,
	Minus,
	Multiply,
	Divide,
}

## 操作符
@export var operation: Operation

##
@export var magnitude: float

##
@export var magnitude_calculations: Array[GameplayModifierMagnitudeCalculation]


func get_magnitude(source: AbilitySystemComponent, target: AbilitySystemComponent) -> float:
	if magnitude_calculations.size() > 0:
		var ret := 0.0
		for mmc in magnitude_calculations:
			ret += mmc.calculate(source, target)
		return ret
	else:
		return magnitude
